import request from "@/request/request";
import { User} from "@/bean/User"
export const loginApi = {
    // 无参后端调用
    async test() {
        const res = (await request.get('/back/user/test')) as void
        return res.value as any
    },
    // 有参get请求
    async login(userId: string, password: string) {
        const res = (await  request.get('/sso/user/login?userId=' + userId + '&password=' + password)) as User
        return res.value as User
    },
    // 有参post请求
    async register(user: User) {
        const res = (await request.post('/sso/user/register', user)) as void
        return res.value as void
    },
}